﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using ZFB.Common;
using ZFB.IServices;
using ZFB.Models;
using ZFB.Repository.AdminLog;

namespace ZFB.Services
{
    public class AdminLogServices:IAdminLogServices
    {
        private readonly IAdminLogRepository adminLogRepository;

        public AdminLogServices(IAdminLogRepository adminLogRepository)
        {
            this.adminLogRepository = adminLogRepository;
        }

        public async Task<ApiResult> AddNewAsync(long adminUserId, string message)
        {
          var res =await adminLogRepository.AddAsync(new T_AdminLogs{AdminUserId=adminUserId,Message=message });
            return res <= 0 ? new ApiResult("添加失败！") : new ApiResult();
        }
    }
}
